home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
SGI Hot Mix 14
/
Hot Mix 14.iso
/
HTML
/
vendors
/
finesse
/
examples
/
sh
/
nastran
< prev
next >
Wrap
Text File
|
1996-06-27
|
4KB
|
171 lines
#! /bin/sh
# FINESSEAPPLICATIONKEY sGCoNXRXpROsz
#
# Create simple front end for nastran jobs
# ----------------------------------------
# ----------------------------------------
#
# Use some NASTRAN Info
#----------------------
NAST_VER="67"
NAST_RC="nast${NAST_VER}rc"
EXE_NAME="NAST${NAST_VER}r2"
# Finesse Initialisation
# ----------------------
. ${FINESSEPATH-/usr/local/finesse}/fsshinit
# Declare input window
# --------------------
yes=Yes
no=No
jidname="Input File"
rcfname="RC File"
sdiname="Scratch Directory"
naswin="
FsWindow -name naswin
-title Finesse;
FsSelectionText -label '$jidname:'
-name selection
-var jid;
FsSelectionText -label '$rcfname:'
-name selection
-var rcf=$NAST_RC;
FsSeparator -name separator;
FsForm -name form1 -orientation horizontal;
FsForm -name form2 -parent form1;
FsList -label '$sdiname:'
-items '/net/ws1/scr
/net/filesrv1/scr/scr1
/net/filesrv1/scr/scr2
/net/filesrv2/scr/scr1
/net/filesrv2/scr/scr1'
-var sdi=/net/filesrv1/scr/scr1
-parent form2 -nvisible 4;
FsSeparator -parent form2 -line no
-name separator1;
FsText -label 'Total Memory (MB):'
-var mem=50 -parent form2
-name text1 -packing tight;
FsText -label 'Scratch Memory (MB):'
-var smem=50 -parent form2
-name text2 -packing tight;
FsSeparator -name midsep -line dashed
-parent form1;
FsForm -name form3 -parent form1;
FsRadio -label 'Batch Job:'
-items '$yes $no' -name radio
-var bat=$yes -parent form3;
FsRadio -label 'Delete Scratch:'
-items '$yes $no' -name radio
-var scr=$yes -parent form3;
FsRadio -label 'Notify when job is done:'
-items '$yes $no' -name radio
-var not=$no -parent form3;
FsRadio -label 'Save old files:'
-items '$yes $no' -name radio
-var old=$yes -parent form3;
FsSeparator -name separator;
FsPushButton -label 'Start Job';
FsPushButton -label 'Job status';
FsPushButton -label Exit;
"
# Plausibility checks:
# --------------------
# Test filenames. $1: variable; $2: name
# ---------------
testname()
{
if [ ! -z "$1" ] ; then
return 0; # correct
else
mesg="$2 missing..."
return 1; # erroneous
fi
}
# Test Memory
# $1: value; $2: lower limit; $3: upper limit
testmem()
{
if [ -z "$1" ] ; then
mesg="No Memory given..."; return 1;
else
var=`expr $1 : '.*\([^0-9]\).*'`
if [ -z "$var" ] ; then
if [ $1 -lt $2 ] ; then
mesg="$1<$2: Memory too small...";
return 1; fi
if [ $1 -gt $3 ] ; then
mesg="$1>$3: Memory too large...";
return 1; fi
return 0;
else
mesg="Bad memory value..."; return 1;
fi
fi
}
# Begin Finesse dialog, open input window
# ---------------------------------------
Fsopen "$@"
Fsdisplay -w "$naswin" -m "Nastran Input"
if [ "$fsbutton" != "o" ] ; then
Fsclose; exit 0; fi
# Check variables, on error reopen window
#----------------------------------------
memlower=10
smemlower=10
memupper=100
smemupper=100
until testname "$jid" "$jidname" &&
testname "$rcf" "$rcfname" &&
testname "$sdi" "$sdiname" &&
testmem $mem $memlower $memupper &&
testmem $smem $smemlower $smemupper
do
Fsdisplay -n naswin -m "$mesg"
if [ "$fsbutton" != "o" ] ; then
Fsclose; exit 0; fi
done
Fssave
# OK, start job
# -------------
# ...
# $EXE_NAME jid=$jid rcf=$rcf sdi=$sdi\
mem=$mem smem=$smem bat=$bat scr=$scr\
not=$not prt=$prt old=$old
# ...
Fsclose